class PageKey():
    """所有元素"""

    def __init__(self, driver):
        """重新父类的初始化"""

        # 实例化
        self.driver = driver

        # 登录
        self.tvLeftBtn = self.driver(resourceId="com.gdu.pro2:id/tvLeftBtn")  # 个人账户登录
        self.tvRightBtn = self.driver(resourceId="com.gdu.pro2:id/tvRightBtn")  # 个人账户登录
        self.et_login_email = self.driver(resourceId="com.gdu.pro2:id/et_login_email")  # 账户
        self.et_login_pwd = self.driver(resourceId="com.gdu.pro2:id/et_login_pwd")  # 密码
        self.incSubLayout1 = self.driver(resourceId="com.gdu.pro2:id/incSubLayout1")  # 登录

        # 调试模式开启
        self.ivFlightIcon = self.driver(resourceId="com.gdu.pro2:id/ivFlightIcon")  # 飞机图标
        self.custom = self.driver(resourceId="com.gdu.pro2:id/custom")  # 密码输入框
        self.dialog_btn_sure = self.driver(resourceId="com.gdu.pro2:id/dialog_btn_sure")  # 确定按钮
        # 调试模式手动飞行参数
        self.tv_arlink = self.driver(resourceId="com.gdu.pro2:id/tv_arlink")  # 图传状态数据
        self.tv_shang_lat2lon_text_info = self.driver(resourceId="com.gdu.pro2:id/tv_shang_lat2lon_text_info")  # 飞行状态数据
        self.tv_frame_rate_info = self.driver(resourceId="com.gdu.pro2:id/tv_frame_rate_info")  # 解码码率数据
        self.tv_speed = self.driver(resourceId="com.gdu.pro2:id/tv_speed")  # 解码数据
        self.tv_WifiQuality = self.driver(resourceId="com.gdu.pro2:id/tv_WifiQuality")  # RTK相关数据
        self.tv_NoiseQuality = self.driver(resourceId="com.gdu.pro2:id/tv_NoiseQuality")  # RTK相关数据
        self.tv_lostPacent = self.driver(resourceId="com.gdu.pro2:id/tv_lostPacent")  # 丢包数据

        # 首页
        self.ivManualFlyBtn = self.driver.xpath("//*[contains(@text,'手动飞行')]")  # 手动飞行
        self.ivTaskFlyBtn = self.driver.xpath("//*[contains(@text,'任务飞行')]")  # 任务飞行
        self.tvCloudName1 = self.driver(resourceId="com.gdu.pro2:id/tvCloudName1")  # 挂载设备1
        self.tv_healthManageLabel = self.driver.xpath("//*[contains(@text,'健康管理')]")  # 健康管理
        self.tvStatusCheckLabel = self.driver.xpath("//*[contains(@text,'状态检查')]")  # 状态检查
        self.ivSelfBtn = self.driver(resourceId="com.gdu.pro2:id/ivSelfBtn")  # 首页设置
        self.tvAlbumLabel = self.driver.xpath("//*[contains(@text,'相册')]")  # 相册

        # ==============================手动飞行==========================================================================
        # 全局设置
        self.logo = self.driver(resourceId="com.gdu.pro2:id/iv_zorroRealcontrol_back")  # logo
        self.iv_zorroRealcontrol_set = self.driver(resourceId="com.gdu.pro2:id/iv_zorroRealcontrol_set")  # 设置按钮
        self.set_1 = self.driver.xpath('//*[@resource-id="com.gdu.pro2:id/rv_left"]/android.view.ViewGroup[1]')
        self.set_2 = self.driver.xpath('//*[@resource-id="com.gdu.pro2:id/rv_left"]/android.view.ViewGroup[2]')
        self.set_3 = self.driver.xpath('//*[@resource-id="com.gdu.pro2:id/rv_left"]/android.view.ViewGroup[3]')
        self.set_4 = self.driver.xpath('//*[@resource-id="com.gdu.pro2:id/rv_left"]/android.view.ViewGroup[4]')
        self.set_5 = self.driver.xpath('//*[@resource-id="com.gdu.pro2:id/rv_left"]/android.view.ViewGroup[5]')
        self.set_6 = self.driver.xpath('//*[@resource-id="com.gdu.pro2:id/rv_left"]/android.view.ViewGroup[6]')
        self.set_7 = self.driver.xpath('//*[@resource-id="com.gdu.pro2:id/rv_left"]/android.view.ViewGroup[7]')
        self.set_8 = self.driver.xpath('//*[@resource-id="com.gdu.pro2:id/rv_left"]/android.view.ViewGroup[8]')

        # 位置参数
        self.tv_dis = self.driver(resourceId="com.gdu.pro2:id/tv_dis")  # 飞行距离
        self.tv_height = self.driver(resourceId="com.gdu.pro2:id/tv_height")  # 飞行高度
        self.x_speed = self.driver(resourceId="com.gdu.pro2:id/x_speed")  # 上升速度
        self.y_speed = self.driver(resourceId="com.gdu.pro2:id/y_speed")  # 水平速度
        self.head_angle = self.driver(resourceId="com.gdu.pro2:id/head_angle")  # 机头角度
        self.tv_ellipsoid = self.driver(resourceId="com.gdu.pro2:id/tv_ellipsoid")  #
        self.tv_altitude = self.driver(resourceId="com.gdu.pro2:id/tv_altitude")  #

        # 飞机状态
        self.tv_rtk1_satellite = self.driver(resourceId="com.gdu.pro2:id/tv_rtk1_satellite")  # 卫星克数
        self.tv_rtk1_status = self.driver(resourceId="com.gdu.pro2:id/tv_rtk1_status")  # 信号模式
        self.tv_aircraft = self.driver(resourceId="com.gdu.pro2:id/tv_aircraft")  # 飞行电池电量
        self.tv_aircraft_energy_v = self.driver(resourceId="com.gdu.pro2:id/tv_aircraft_energy_v")  # 飞行电池电压
        self.tv_electricity_control = self.driver(resourceId="com.gdu.pro2:id/tv_electricity_control")  # 遥控器电池电量
        self.tv_currentIsSportModel = self.driver(resourceId="com.gdu.pro2:id/tv_currentIsSportModel")  # 飞机姿态

        # 镜头切换
        self.hongwai = self.driver.xpath("//*[contains(@text,'红外')]")  # 红外
        self.guangjiao = self.driver.xpath("//*[contains(@text,'广角')]")  # 广角
        self.bianjiao = self.driver.xpath("//*[contains(@text,'变焦')]")  # 变焦
        self.fenping = self.driver.xpath("//*[contains(@text,'分屏')]")  # 分屏

        # 云台角度
        self.iv_quick_gimbal_control = self.driver(resourceId="com.gdu.pro2:id/iv_quick_gimbal_control")  # 云台一键控制
        self.iv_pitch_center_yaw_center = self.driver(resourceId="com.gdu.pro2:id/iv_pitch_center_yaw_center")  # 回中
        self.iv_pitch_center_yaw_bottom = self.driver(resourceId="com.gdu.pro2:id/iv_pitch_center_yaw_bottom")  # 回中下视
        self.iv_pitch_center = self.driver(resourceId="com.gdu.pro2:id/iv_pitch_center")  # 方位回中
        self.iv_yaw_bottom = self.driver(resourceId="com.gdu.pro2:id/iv_yaw_bottom")  # 下视

        # 相机控制
        self.tvEvSetContent = self.driver(resourceId="com.gdu.pro2:id/tvEvSetContent")  # EV值
        self.ivAELockBtn = self.driver(resourceId="com.gdu.pro2:id/ivAELockBtn")  # EV状态 selected：true=解锁  false=上锁
        self.tvStorageContent = self.driver(resourceId="com.gdu.pro2:id/tvStorageContent")  # SD卡容量
        self.tv_angle = self.driver(resourceId="com.gdu.pro2:id/tv_angle")  # 云台角度
        self.ivSwitchBtn = self.driver(resourceId="com.gdu.pro2:id/ivSwitchBtn")  # 拍照/视频切换
        self.tvLabel_p = self.driver.xpath("//*[contains(@text,'拍照')]")  # 选择拍照
        self.tvLabel_v = self.driver.xpath("//*[contains(@text,'视频')]")  # 选择视频
        self.ivSwitchBtn = self.driver(resourceId="com.gdu.pro2:id/ivSwitchBtn")  # 录像时间
        self.ivPhotoAndVideoBtn = self.driver(resourceId="com.gdu.pro2:id/ivPhotoAndVideoBtn")  # 拍摄
        self.ivGalleryBtn = self.driver(resourceId="com.gdu.pro2:id/ivGalleryBtn")  # 相册
        self.ivSettingBtn = self.driver(resourceId="com.gdu.pro2:id/ivSettingBtn")  # 相机设置

        # 一键起飞，一键降落
        self.iv_landOrLock = self.driver(resourceId="com.gdu.pro2:id/iv_landOrLock")  # 一键起飞
        self.but_take_off = self.driver(resourceId="com.gdu.pro2:id/but_take_off")  # 确定起飞
        self.iv_returnOrFlyByOneKey = self.driver(resourceId="com.gdu.pro2:id/iv_returnOrFlyByOneKey")  # 一键返航
        self.but_take_off = self.driver(resourceId="com.gdu.pro2:id/dialog_btn_sure")  # 确定降落

        # 飞机设置
        self.et_height_limit = self.driver(resourceId="com.gdu.pro2:id/et_height_limit")  # 限制高度
        self.iv_switch_limit_distance = self.driver(resourceId="com.gdu.pro2:id/iv_switch_limit_distance")  # 限距开关
        self.et_distance_limit = self.driver(resourceId="com.gdu.pro2:id/et_distance_limit")  # 限制距离
        self.et_height = self.driver(resourceId="com.gdu.pro2:id/et_height")  # 返航高度
        self.et_back_speed = self.driver(resourceId="com.gdu.pro2:id/et_back_speed")  # 返航速度
        self.ov_out_of_control = self.driver(resourceId="com.gdu.pro2:id/ov_out_of_control")  # 失联行为
        self.ov_return_home = self.driver(resourceId="com.gdu.pro2:id/ov_return_home")  # 返航行为
        self.ov_gnss = self.driver(resourceId="com.gdu.pro2:id/ov_gnss")  # 卫星定位系统

        # 电池设置
        self.flight_battery = self.driver(resourceId="com.gdu.pro2:id/flight_battery")  # 飞行器电池
        self.rc_battery = self.driver(resourceId="com.gdu.pro2:id/rc_battery")  # 遥控器电池
        self.tv_batteryPercent = self.driver(resourceId="com.gdu.pro2:id/tv_batteryPercent")  # 剩余电量
        self.value_edit_d = self.driver.xpath(
            '//*[@resource-id="com.gdu.pro2:id/lowPowerWarnSb"]/android.view.ViewGroup[1]/android.widget.EditText[1]')  # 低电量报警值
        self.value_edit_cd = self.driver.xpath(
            '//*[@resource-id="com.gdu.pro2:id/lowestPowerWarnSb"]/android.view.ViewGroup[1]/android.widget.EditText[1]')  # 超低电量报警值

        # 图传设置
        self.ov_gnss = self.driver(resourceId="com.gdu.pro2:id/ov_gnss")  # 卫星定位系统
        self.ov_gnss = self.driver(resourceId="com.gdu.pro2:id/ov_gnss")  # 卫星定位系统
        self.ov_gnss = self.driver(resourceId="com.gdu.pro2:id/ov_gnss")  # 卫星定位系统
        self.ov_gnss = self.driver(resourceId="com.gdu.pro2:id/ov_gnss")  # 卫星定位系统
        self.ov_gnss = self.driver(resourceId="com.gdu.pro2:id/ov_gnss")  # 卫星定位系统
        self.ov_gnss = self.driver(resourceId="com.gdu.pro2:id/ov_gnss")  # 卫星定位系统

